home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-imgint.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  53 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                       S Y S T E M . I M G _ I N T                        --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.8 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package contains the routines for supporting the Image attribute for
  27. --  signed integer types up to Size Integer'Size, and also for conversion
  28. --  operations required in Text_IO.Integer_IO for such types.
  29.  
  30. package System.Img_Int is
  31. pragma Pure (Img_Int);
  32.  
  33.    function Image_Integer
  34.      (V    : Integer;
  35.       S    : access String)
  36.       return Natural;
  37.    --  Computes Integer'Image (V) and stores the result in S (1 .. N) where
  38.    --  N is the length of the image string. The value of N is returned as
  39.    --  the result. The caller guarantees that the string is long enough.
  40.  
  41.    procedure Set_Image_Integer
  42.      (V : Integer;
  43.       S : out String;
  44.       P : in out Natural);
  45.    --  Sets the image of V starting at S (P + 1) with no leading spaces (i.e.
  46.    --  Text_IO format where Width = 0), starting at S (P + 1), updating P
  47.    --  to point to the last character stored. The caller promises that the
  48.    --  buffer is large enough and no check is made for this (Constraint_Error
  49.    --  will not be necessarily raised if this is violated since it is perfectly
  50.    --  valid to compile this unit with checks off).
  51.  
  52. end System.Img_Int;
  53.